package org.compiere.model;

import java.math.BigDecimal;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.List;
import java.util.Properties;
import java.util.logging.Level;

import org.compiere.util.CLogger;
import org.compiere.util.DB;
import org.compiere.util.Env;
import org.compiere.util.Trx;

public class MBCSFRInputFormLine extends X_BCS_FRInputFormLine{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private static CLogger s_log = CLogger.getCLogger(MBCSFRInputFormLine.class);
	
	
	public MBCSFRInputFormLine(Properties ctx, int MBCSFRInputFormLine_ID,
			String trxName) {
		super(ctx, MBCSFRInputFormLine_ID, trxName);
		// TODO Auto-generated constructor stub
	}
	
	public MBCSFRInputFormLine(Properties ctx, ResultSet rs, String trxName){
		super(ctx, rs, trxName);
	}
	

	protected boolean afterDelete(boolean success){

		DB.executeUpdate("delete BCS_FRInputFormColumn WHERE BCS_FRInputFormLine_ID ="  +  get_ID());
//	    PreparedStatement pstmt = null;
//		ResultSet rs = null;
//		String sql = "";	
//
//		
//		//delete companies
////		sql = " SELECT BCS_FRInputFormColumn_ID FROM BCS_FRInputFormColumn \n " +
////				   " WHERE BCS_FRInputFormLine_ID ="  +  get_ID();
//			try{
//				pstmt = DB.prepareStatement(sql,null);				
//				rs = pstmt.executeQuery();	
//				while(rs.next()){
//					MBCSFRInputFormColumn column = new MBCSFRInputFormColumn(Env.getCtx(), rs.getInt(1), null);
//					if(column != null)
//						column.delete(true);
//				}
//			}catch (SQLException e){
//				s_log.log(Level.SEVERE, "MBCSFRInputFormPeriod", e);
//			}finally{
//				DB.close(rs, pstmt);
//				rs = null; pstmt = null;
//			}			

		return true;
	}
	
}
